package com.stores.viewModel;

import java.util.List;

import com.stores.model.Product;

public class ProductInsertViewModel {
	private String name;
	private String shortDescription;
	private String longDescription;
	private double costPrice;
	private long brandId;
	private List<Long> categoryIds;
	private List<Long> varialtionIds;
	private int unitsInStock;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getShortDescription() {
		return shortDescription;
	}

	public void setShortDescription(String shortDescription) {
		this.shortDescription = shortDescription;
	}

	public String getLongDescription() {
		return longDescription;
	}

	public void setLongDescription(String longDescription) {
		this.longDescription = longDescription;
	}

	public double getCostPrice() {
		return costPrice;
	}

	public void setCostPrice(double costPrice) {
		this.costPrice = costPrice;
	}

	public long getBrandId() {
		return brandId;
	}

	public void setBrandId(long brandId) {
		this.brandId = brandId;
	}

	public List<Long> getCategoryIds() {
		return categoryIds;
	}

	public void setCategoryIds(List<Long> categoryIds) {
		this.categoryIds = categoryIds;
	}

	public List<Long> getVarialtionIds() {
		return varialtionIds;
	}

	public void setVarialtionIds(List<Long> varialtionIds) {
		this.varialtionIds = varialtionIds;
	}

	public int getUnitsInStock() {
		return unitsInStock;
	}

	public void setUnitsInStock(int unitsInStock) {
		this.unitsInStock = unitsInStock;
	}
	
	/***
	 * 
	 * @return
	 */
	public Product ToEntity(){
		Product p = new Product();
		p.setBrandId(this.getBrandId());
		p.setCategoryIds(this.getCategoryIds());
		p.setCostPrice(this.getCostPrice());
		p.setLongDescription(this.getLongDescription());
		p.setName(this.getName());
		p.setShortDescription(this.getShortDescription());
		p.setUnitsInStock(this.getUnitsInStock());
		//p.setVarialtionIds(this.getVarialtionIds());
		return p;
	}
}
